
package Individual;

import Settings.*;

public class MutationFunctions {

    public static void mutation(Individual[] individuals) {

        switch(Settings.MUTATION_FUNCTION_TYPE) {
            case 0:
                mutationStandard(individuals);
                break;
        }
    }

    private static void mutationStandard(Individual[] individuals) {

        for(int i = 0; i < individuals.length; ++i) {

            for(int c = 0; c < individuals[i].numOfClusters; ++c) {

                for(int f = 0; f < individuals[i].numOfFeatures; ++f) {

                    for(int b = 0; b < individuals[i].numOfBitsPerValue; ++b) {
                        if(Math.random() < Settings.PROPABILITY_MUTATION) {
                            individuals[i].chromosome.get(c).get(f).flip(b);
                        }

                    }
                }
            }
        }
        
    }

}

